#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
string tmp = "cocacola";
int res = 1e9;
string s;
void dfs(int u, int cnt)
{
    if (u == 8)
    {
        res = min(res, cnt);
        return;
    }
    if (s[u] == tmp[u])
        dfs(u + 1, cnt);
    else
    {
        for (int i = u + 1; i < 8; i++)
        {
            if (s[i] == tmp[u])
            {
                swap(s[i], s[u]);
                dfs(u + 1, cnt + 1);
                swap(s[i], s[u]);
            }
        }
    }
}
int main()
{
    cin >> s;
    dfs(0, 0);
    cout << res;
    return 0;
}

